package lm.concurrency.day5.singletons;

/**
 * @Auther: Min.Liu
 * @Description:
 * @Date: Created in 10:49 2024/11/7
 */
public final class Singleton5 {
    private Singleton5() { }
    // 问题1：属于懒汉式还是饿汉式
    private static class LazyHolder {
        static final Singleton5 INSTANCE = new Singleton5();
    }
    // 问题2：在创建时是否有并发问题
    public static Singleton5 getInstance() {
        return LazyHolder.INSTANCE;
    }

}
